package com.sg.gara.dao;

import java.util.List;

import org.apache.log4j.Logger;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.sg.gara.entity.TmsSyss;

@Repository
public class TmsSyssDAOImpl implements TmsSyssDAO {

	//final Logge logger = LoggerFactory.getLogger(TmsSyssDAOImpl.class);
	private static final Logger log = Logger.getLogger(TmsSyssDAOImpl.class);
	
	@Autowired
	SessionFactory sessionFactory;
	
	
	public TmsSyss get(Integer id) {
		log.debug("********************* LOG DEBUG  ***************************");
		log.info("********************* LOG INFO  ***************************");
		
		return (TmsSyss)sessionFactory.getCurrentSession().get(TmsSyss.class, id);
	}

	@SuppressWarnings("unchecked")
	public List<TmsSyss> list() {
		List<TmsSyss> result = sessionFactory.getCurrentSession().createQuery("from TmsSyss ").list();
		
		return result;
	}

}
